<template>
  <div>
    <el-button @click="btnClick">全屏</el-button>
    <!--
        全屏插件：screenfull
        1:  安装：  yarn add screenfull@5.0.0
        2:  导入   import screenfull from 'screenfull'
        3：使用
             screenfull.isEnabled:判断浏览器是否支持
             screenfull.toggle()  切换
     -->
  </div>
</template>
<script>
import screenfull from 'screenfull'
export default {
  methods: {
    btnClick() {
      console.log(screenfull)
      if (screenfull.isEnabled) {
        screenfull.toggle()
      } else {
        this.$message.error('该浏览器不支持全屏')
      }
    }
  }
}
</script>
<style></style>
